package test

import java.io.{InputStream, ObjectInputStream}
import java.net.{ServerSocket, Socket}

object Executor {
  def main(args:Array[String]):Unit={
    //创建启动服务器，接受数据
    val server=new ServerSocket(9999)
    println("服务器等待接受数据：")
    //等待客户端链接
    val client:Socket=server.accept()

    val in:InputStream = client.getInputStream
    val objIn=new ObjectInputStream(in)
    val task:Task=objIn.readObject().asInstanceOf[Task]
    val ints:List[Int]=task.compute()
    println("接受到客户端的数据为："+ints)
    objIn.close()
    client.close()
    server.close()

  }

}
